home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
bbs
/
cuser125.zip
/
COOLUSER.MEX
< prev
next >
Wrap
Text File
|
1997-07-12
|
12KB
|
478 lines
//////////////////////////////////////////////////////////////////////////////
//
// CoolUser V1.25 (C)1996-1997 by Neil Staib
//
// MEX: Copywrite 1990, 1995 by Lanius Corporation. All Rights reserved.
//
//////////////////////////////////////////////////////////////////////////////
#include <max.mh> include <max.mh> //
#include <intpad.mh>
#define INCL_global
#define INCL_cooluser
#include <language.mh>
#include <cooluser.mh>
void writeinkey(string: inkey);
void main()
{
char: inkey, nonstop;
string: name, datedob, instr, temp_day1, temp_month1;
int: nameint, nameco, done, this_year, len, temp_day, temp_month;
int: temp_year,checkno3,checkno4, checkno2;
struct _stamp:now;
init_lang_cooluser();
checkno3:=checkfile("cucheck.3");
if (checkno3 = 0)
{
remove(str_st_dir_txt + "cucheck.3");
goto getfull;
}
checkno4:=checkfile("cucheck.4");
if (checkno4 = 0)
{
remove(str_st_dir_txt + "cucheck.4");
goto getinfo;
}
checkno2:=checkfile("cucheck.2");
if (checkno2 = 0)
{
remove(str_st_dir_txt + "cucheck.2");
}
getfull:
print(COL_GRAY, "\n", AVATAR_CLEOL, str_st_menu, str_st_menu_first, ", [", str_st_active_keys, "?", str_st_menu, "] ", str_st_menu_second, " [", str_st_active_keys, "*", str_st_menu, "] " , str_st_menu_third, " : ");
getinfo:
inkey:=getch();
if (inkey = '*')
{
remove(str_st_dir_txt + "cucheck.1");
remove(str_st_dir_txt + "cucheck.2");
remove(str_st_dir_txt + "cucheck.3");
remove(str_st_dir_txt + "cucheck.4");
log(":COOLUSER: "+ str_st_log_end);
print(str_st_menu_display, "*");
print(AVATAR_CLS);
return;
}
if (inkey = 13)
{
goto start;
}
if (inkey = '?')
{
pageheader();
print(AVATAR_UP);
display_file(str_st_dir_txt + "cuhelp", nonstop);
goto start;
}
if (inkey = 'H' or inkey = 'h') // Handle
{
print(str_st_menu_display, 'H');
#ifdef handle_opt
{
editoption(4, 34, 4, 34, "", 35, '░', str_st_edit);
name:=inputuser(20);
nameint:=strtoi(name);
if (strlen(name) = 0)
{
goto start;
}
log(":COOLUSER: "+ str_st_log_handle);
usr.alias := name;
goto start;
}
#else
{
optionbad();
goto start;
}
#endif
}
if (inkey = 'B' or inkey ='b') // Date of Birth
{
#ifdef birth_opt
{
timestamp(now);
this_year:=now.date.year+1980;
#ifdef USDATE
datedob := "MM-DD-YY";
#endif
#ifdef EUDATE
datedob := "DD-MM-YY";
#endif
#ifdef JPDATE
datedob := "YY-MM-DD";
#endif
dobformat:
print(AVATAR_GOTO, (char)8, (char)34);
print(str_st_edit, padleft("", 10, '░'));
print(COL_GRAY, " ", str_st_menu_display, datedob);
print(AVATAR_GOTO, (char)8,(char)34);
len := input_str(instr, INPUT_NLB_LINE, 0, 10, "");
if(len=0)
{
goto start;
}
else
log(":COOLUSER: "+ str_st_log_dob);
// Parse all digits
#ifdef EUDATE
{
temp_day:=getdigit(instr);
temp_month:=getdigit(instr);
temp_year:=getdigit(instr);
}
#endif
#ifdef USDATE
{
temp_month:=getdigit(instr);
temp_day:=getdigit(instr);
temp_year:=getdigit(instr);
}
#endif
#ifdef JPDATE
{
temp_year:=getdigit(instr);
temp_month:=getdigit(instr);
temp_day:=getdigit(instr);
}
#endif
if (temp_day=0 OR temp_month=0 OR temp_year=0)
goto dobformat;
else
{
// Fix year if only two digits entered
if (temp_year < 100)
{
temp_year:=temp_year+((this_year/100)*100);
if (temp_year > this_year)
temp_year := temp_year - 100;
}
// Now, validate all fields
if (temp_year <= 1900 or temp_year > (this_year-min_age))
{
goto dobformat;
}
else
{
if (temp_month < 1 or temp_month > 12)
goto start;
else if (temp_day < 1 or temp_day > 31)
goto start;
else // instr ok
{
if (temp_month < 10)
{
temp_month1 := "0" + itostr(temp_month);
}
else
{
temp_month1 := itostr(temp_month);
}
if (temp_day < 10)
{
temp_day1 := "0" + itostr(temp_day);
}
else
{
temp_day1 := itostr(temp_day);
}
// Format the user's DOB as "yyyy.mm.dd"
// and store in user record
usr.dob := itostr(temp_year) + "." +
temp_month1 + "." +
temp_day1;
}
}
}
goto start;
}
#else
{
print(str_st_menu_display, 'B');
optionbad();
goto start;
}
#endif
}
if (inkey = 'X' or inkey ='x') // Gender
{
print(str_st_menu_display, 'X');
#ifdef gender_opt
{
log(":COOLUSER: "+ str_st_log_gender);
if (usr.sex = 1)
{
usr.sex := 2;
editoption(9, 34, 21, 34, UserSex(usr.sex), 6, ' ', str_st_data_fields);
goto getfull;
}
if (usr.sex = 2)
{
usr.sex := 1;
editoption(9, 34, 21, 34, UserSex(usr.sex), 6, ' ', str_st_data_fields);
goto getfull;
}
if (usr.sex = 0)
{
usr.sex := 1;
editoption(9, 34, 21, 34, UserSex(usr.sex), 6, ' ', str_st_data_fields);
goto getfull;
}
}
#else
{
optionbad();
goto start;
}
#endif
}
if (inkey = 'L' or inkey ='l') // Language
{
print(str_st_menu_display, 'L');
#ifdef language_opt
{
log(":COOLUSER: "+ str_st_log_lang);
print(AVATAR_CLS);
pageheader();
menu_cmd(616, "");
goto start;
}
#else
{
optionbad();
goto start;
}
#endif
}
if (inkey = 'R' or inkey ='r') // RIP Mode
{
#ifdef rip_opt
{
log(":COOLUSER: "+ str_st_log_rip);
if (usr.rip = 0)
{
usr.rip := 1;
editoption(20, 71, 21, 34, Bool(usr.rip), 4, ' ' , str_st_data_fields);
goto getfull;
}
if (usr.rip = 1)
{
usr.rip := 0;
editoption(20, 71, 21, 34, Bool(usr.rip), 4, ' ' , str_st_data_fields);
goto getfull;
}
}
#else
{
print(str_st_menu_display, 'R');
optionbad();
goto start;
}
#endif
}
if (inkey = 'F' or inkey ='f') // Help Level
{
print(str_st_menu_display, 'F');
#ifdef help_opt
{
log(":COOLUSER: "+ str_st_log_help);
if (usr.help = 6)
{
usr.help := 4;
editoption(13, 34, 21, 34, HelpLevel(usr.help), 8, ' ' , str_st_data_fields);
goto getfull;
}
if (usr.help = 4)
{
usr.help := 2;
editoption(13, 34, 21, 34, HelpLevel(usr.help), 8, ' ' , str_st_data_fields);
goto getfull;
}
if (usr.help = 2)
{
usr.help := 6;
editoption(13, 34, 21, 34, HelpLevel(usr.help), 8, ' ' , str_st_data_fields);
goto getfull;
}
}
#else
{
optionbad();
goto start;
}
#endif
}
if (inkey = 'S' or inkey ='s') // Screen Width
{
print(str_st_menu_display, 'S');
#ifdef scn_width_opt
{
log(":COOLUSER: "+ str_st_log_scn_width);
editoption(16, 34, 16, 34, "", 4, '░' , str_st_edit);
name:=inputuser(2);
nameint:=strtoi(name);
if (strlen(name) = 0)
{
goto start;
}
usr.width := nameint;
goto start;
}
#else
{
optionbad();
goto start;
}
#endif
}
if (inkey = 'U' or inkey ='u') // Hidden from Userlist
{
writeinkey("u");
return;
}
if (inkey = 'T' or inkey ='t') // AVATAR Mode
{
writeinkey("t");
return;
}
if (inkey = 'E' or inkey = 'e') // Full Screen Msg Editor
{
writeinkey("e");
return;
}
if (inkey = 'C' or inkey = 'c') // Clear Screen Codes
{
print(str_st_menu_display, 'C');
optionbad();
goto start;
}
if (inkey = 'Q' or inkey = 'q') // Quite Mode
{
writeinkey("q");
return;
}
if (inkey = 'N' or inkey = 'n') // ANSI mode
{
writeinkey("n");
return;
}
if (inkey = 'W' or inkey = 'w') // Full Screen Msg Viewer
{
writeinkey("w");
return;
}
if (inkey = 'G' or inkey = 'g') // Screen Length
{
writeinkey("g");
return;
}
if (inkey = 'M' or inkey = 'm') // More Prompt
{
writeinkey("m");
return;
}
if (inkey = 'K' or inkey = 'k') // Hot Keys
{
writeinkey("k");
return;
}
if (inkey = 'A' or inkey = 'a') // Default Archiver
{
writeinkey("a");
return;
}
if (inkey = 'Z' or inkey = 'z') // Default Protocol
{
writeinkey("z");
return;
}
if (inkey = 'I' or inkey = 'i') // Location
{
writeinkey("i");
return;
}
if (inkey = 'V' or inkey = 'v') // Voice/Home Phone
{
writeinkey("v");
return;
}
if (inkey = 'D' or inkey = 'd') // Business/ Data Phone
{
writeinkey("d");
return;
}
if (inkey = 'P' or inkey = 'p') // Password
{
writeinkey("p");
return;
}
goto getinfo;
start:
writefile("cucheck.1"); // Display Main Menu
}
void writeinkey(string: inkey)
{
int:fd;
fd:=open(str_st_dir_txt + "cucheck.2", IOPEN_CREATE | IOPEN_WRITE);
writeln(fd, inkey);
close(fd);
}